import { applyMiddleware, compose, createStore } from "redux";
import { RootReducer } from "./Global/reducer";
import { RootSaga, sagaMiddleWare } from "./Global/saga";

//@ts-ignore
const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({}) : compose;

const store = createStore(
    RootReducer,
    composeEnhancers(applyMiddleware(sagaMiddleWare))
);


sagaMiddleWare.run(RootSaga);


export default store;
